/*
*	New C++ File starts here.
*	This file should be named clock.cc
*/

// Include all NML, CMS, and RCS classes and functions
#include "rcs.hh"

// Include command and status message definitions
#include "clock.hh"

// Include externally supplied prototypes
#include "clock_n_codegen_protos.hh"



#ifndef MAX_MY_CLOCK_NAME_LENGTH
#define MAX_MY_CLOCK_NAME_LENGTH 9
#endif
#ifndef MY_CLOCK_NAME_LIST_LENGTH
#define MY_CLOCK_NAME_LIST_LENGTH 2
#endif


/* This list must be in alphabetical order and the three lists must correspond. */
const char MY_CLOCK_name_list[MY_CLOCK_NAME_LIST_LENGTH][MAX_MY_CLOCK_NAME_LENGTH]= {
	"MY_CLOCK", /* 0,1001 */
	""};
const NMLTYPE MY_CLOCK_id_list[MY_CLOCK_NAME_LIST_LENGTH]= {
	MY_CLOCK_TYPE, /* 0,1001 */
	-1};
const size_t MY_CLOCK_size_list[MY_CLOCK_NAME_LIST_LENGTH]= {
	sizeof(MY_CLOCK),
	0};
const char *MY_CLOCK_symbol_lookup(long type);


// Enumerated Type Constants

/*
Estimated_size	MY_CLOCK	48
Estimated_size	MAXIMUM	48
*/
/*
*	NML/CMS Format function : MY_CLOCK_format
*	Automatically generated by NML CodeGen Java Applet.
*	on Tue May 13 15:49:58 GMT-05:00 2008
*/
int MY_CLOCK_format(NMLTYPE type, void *buffer, CMS *cms)
{

	type = cms->check_type_info(type,buffer,"MY_CLOCK",
		(cms_symbol_lookup_function_t) MY_CLOCK_symbol_lookup,
		(const char **)MY_CLOCK_name_list,
		MY_CLOCK_id_list,MY_CLOCK_size_list,
		MY_CLOCK_NAME_LIST_LENGTH,
		MAX_MY_CLOCK_NAME_LENGTH);

	switch(type)
	{
	case MY_CLOCK_TYPE:
		((MY_CLOCK *) buffer)->update(cms);
		break;

	default:
		return(0);
	}
	return 1;
}


// NML Symbol Lookup Function
const char *MY_CLOCK_symbol_lookup(long type)
{
	switch(type)
	{
	case MY_CLOCK_TYPE:
		return "MY_CLOCK";
	default:
		return"UNKNOWN";
		break;
	}
	return(NULL);
}

/*
*	NML/CMS Update function for MY_CLOCK
*	Automatically generated by NML CodeGen Java Applet.
*	on Tue May 13 15:49:58 GMT-05:00 2008
*/
void MY_CLOCK::update(CMS *cms)
{

	cms->beginClass("MY_CLOCK","NMLmsg");
	cms->update_with_name("now",now);

	cms->endClass("MY_CLOCK","NMLmsg");

}

/*
*	Constructor for MY_CLOCK
*	Automatically generated by NML CodeGen Java Applet.
*	on Tue May 13 15:49:58 GMT-05:00 2008
*/
MY_CLOCK::MY_CLOCK()
	: NMLmsg(MY_CLOCK_TYPE,sizeof(MY_CLOCK))
{

}

